/*
 * connection_listener.h
 *
 *  Created on: 2009-1-7
 *      Author: fanliangliang
 */

#ifndef CONNECTION_LISTENER_H_
#define CONNECTION_LISTENER_H_

#include "toxic.h"

using toxic::Thread;
using toxic::TcpServer;

// forward declaration
class FileReceiver;
class Application;

class ConnectionListener : public Thread {
public:
	ConnectionListener(FileReceiver* receiver, Application* application);
	virtual ~ConnectionListener();
	virtual void run();

	void stop();

private:
	Application* application_;
	FileReceiver* receiver_;
	TcpServer server_;
	bool isRunning_;
};

#endif /* CONNECTION_LISTENER_H_ */
